//
//  Global.h
//  omni
//
//  Created by Phuong Dinh Le on 1/25/13.
//  Copyright (c) 2013 StarPound. All rights reserved.
//

#import <Foundation/Foundation.h>

#define HTTP_REPONSE_OK 200

// Gold Price
#define SJC_GOLD_PRICE_URL @"http://www.sjc.com.vn/xml/tygiavang.xml"
#define XPATH_SJC_GOLD_PRICE @"/root/ratelist"

// Exchange rates
#define VCB_EXCHANGE_RATES_URL @"http://vietcombank.com.vn/ExchangeRates/ExrateXML.aspx"
#define XPATH_EXCHANGE_RATES_EXRATES @"/ExrateList/*"

#define UPDATE_GOLD_PRICE_INTERVAL 60.0f

#define KEY_UPDATED_DATE @"UpdatedDate"
#define KEY_GOLD_PRICES @"GoldPrices"
#define KEY_EXCHAGE_RATES @"ExchangeRates"

#define EXCHANGE_RATES_UPDATED_DATE_FORMAT @"MM/dd/yyyy hh:mm:ss a"
#define GOLD_PRICES_UPDATED_DATE_FORMAT @"hh:mm:ss a dd/MM/yyyy"

#define DISPLAY_DATE_FORMAT @"dd/MM/yyyy hh:mm a"
#define DISPLAY_DATE_FORMAT_SHORT @"dd/MM hh:mm a"

#define GOLD_CODE_KEY @"GoldType"
#define GOLD_BUY_KEY @"PriceBuy"
#define GOLD_SELL_KEY @"PriceSell"
#define PRE_GOLD_BUY_KEY @"PrePriceBuy"
#define PRE_GOLD_SELL_KEY @"PrePriceSell"

#define RATE_CODE_KEY @"CurrencyCode"
#define RATE_BUY_KEY @"Buy"
#define RATE_TRANSFER_KEY @"Transfer"
#define RATE_SELL_KEY @"Sell"
#define PRE_RATE_BUY_KEY @"PreBuy"
#define PRE_RATE_TRANSFER_KEY @"PreTransfer"
#define PRE_RATE_SELL_KEY @"PreSell"

#define PREV_GOLD_PRICE_KEY @"PreviousGoldPrice"
#define CURR_GOLD_PRICE_KEY @"CurrentGoldPrice"

#define PREV_RATE_KEY @"PreviousExchangeRates"
#define CURR_RATE_KEY @"CurrentExchangeRates"

#define DEFAULT_CHANGED_LABEL @"-\n-"
#define FORMAT_CHANGED_LABEL @"%@%@\n%@%.1f%%"

typedef enum
{
    ThreadRun = 0,
    ThreadPause,
    ThreadFilter,
    ThreadStop
} ThreadStatus;



